package com.chenpeijian.demo.service.dto;

import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * @program: student_code
 * @description:
 * @author: 陈培建
 * @create: 2024-12-12 17:03
 **/
@Data
public class UserRegistrationRequest {
    @NotNull(message = "用户名不能为空")
    @Size(min = 3, max = 20, message = "用户名长度必须在3到20之间")
    private String username;

    @NotNull(message = "密码不能为空")
    @Size(min = 8, message = "密码长度至少为8个字符")
    private String password;

    @NotNull(message = "年龄不能为空")
    @Min(value = 1, message = "年龄必须是正整数")
    @Max(value = 120, message = "年龄不能超过120")
    private Integer age;
    @NotEmpty(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;
}
